<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
</head>
<style>
    .trap{
        position: relative;
        height: 150px;
        width: 150px;
    }
    .trap:before{
        content:"";
        transform:perspective(5px) rotateX(-5deg) ;
        transform-origin:right;
        background: yellowgreen;
        position: absolute;
        top: 0;
        /*bottom: 0;*/
        /*left: 0;*/
        width: 20px;
        height: 20px;
        right: 0;
        z-index: -1;
    }
</style>
<body>
<div class="trap">
    梯形
</div>
</body>

</html>